#ifndef MAP_BRIDGE_H
#define MAP_BRIDGE_H

#include <QObject>
#include <QDebug>
#include <QFile>

class MapBridge : public QObject {
    Q_OBJECT
public:
    explicit MapBridge(QObject *parent = nullptr) : QObject(parent) {}

public slots:
    void receiveGeoJSON(const QString &json) {
        // 这里可以将json保存到文件或处理
        qDebug() << "收到GeoJSON:" << json;
        // 例如写入文件
        QFile file("map_data.json");
        if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
            file.write(json.toUtf8());
            file.close();
        }
    }
};

#endif // MAP_BRIDGE_H
